package com.gupaoedu.vip.simplefactory;

import com.gupaoedu.vip.model.HuaweiPhone;
import com.gupaoedu.vip.model.IPhone;
import com.gupaoedu.vip.model.XiaomiPhone;

public class SimpleFactoryTest {

    public static void main(String[] args) {
        SimpleFactory simpleFactory = new SimpleFactory();
        XiaomiPhone xiaomiPhone = (XiaomiPhone) simpleFactory.getPhone("小米手机");
        System.out.println(xiaomiPhone.getName());

        HuaweiPhone huaweiPhone = (HuaweiPhone) simpleFactory.getPhone("华为手机");
        System.out.println(huaweiPhone.getName());

        IPhone iPhone = (IPhone) simpleFactory.getPhone("苹果手机");
        System.out.println(iPhone.getName());
    }
}
